<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    const list = [9, 20, 205, 25, 30, 7, 42, 50, 105]

    console.log('前：', list)
    list.sort((a, b) => a - b)
    // const newArray = list.filter(function(item) {
    //   return item % 3 === 0
    // })
    const newArray = list.filter(item => item % 3 === 0).concat(list.filter(item => item % 3 !== 0))
    console.log('后：', list)
    console.log('新：', newArray)
  </script>
</body>
</html>